# coding: utf-8
import os

from openpyxl import Workbook, load_workbook

wb = load_workbook(r'D:\Personal Files\内江师范学院\19.3名单.xlsx')
sheet = wb.worksheets[0]
student_list = []
now_list = []

for row_num in range(3, 77):
    student_list.append(sheet.cell(row=row_num, column=2).value)

path = r"D:\Personal Files\内江师范学院\2022年2月23日返校材料\个人为单位"
file_names = os.listdir(path)

for filename in file_names:
    name_split = filename.split('19.3')  # 去除班级
    name = name_split[1].split('返校材料')[0]  # 提取姓名
    now_list.append(name)

print(f'已交{len(now_list)}/{len(student_list)}')
print(f'未交：{list(set(student_list).difference(set(now_list)))}')
